﻿namespace H.Types
{
    /// <summary>
    /// 可写的键值对,类似KeyValuePair,但是这是可写入的
    /// </summary>
    /// <typeparam name="K">键类型</typeparam>
    /// <typeparam name="V">值类型</typeparam>
    public struct KV<K, V>
    {
        /// <summary>
        /// 键值对的键
        /// </summary>
        public K Key { get; set; }

        /// <summary>
        /// 键值对的值
        /// </summary>
        public V Value { get; set; }

        /// <summary>
        /// 初始化一个键值对
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public KV(K key, V value)
        {
            Key = key;
            Value = value;
        }
    }
}
